<?php

class Links_Backend_Links_Edit extends Kernel_Action_Form_Simple 
{
    
    /**
     * Основная таблица, в которой хранится редактируемый элемент.
     *
     * @var string
     */
    protected $_table = 'links';
    
    /**
     * Initialize form elements. 
     *
     */
    protected function _initElements() 
    {
        parent::_initElements();
        
        $this->_setElementParam('category_id', array(
            'type' => 'list', 
            'values' => Links_Utils::filtersList(), 
            'value' => Links_Utils::activeFilter(), 
            ));
        
        $this->_setAsRequired('category_id', 'url');
    }
    
    protected function _done() 
    {
        $this->redirect_url = str_replace('filter', $this->_getValue('category_id'), $this->redirect_url);
        parent::_done();
    }
    
}